【github项目】又发现一个轻量级开源UI nuklear,酷炫界面,支持矢量字体。 / 计算机图形/GUI/RTOS/FileSystem/OpenGL/DirectX/SDL2 / WhyCan Forum(哇酷开发者社区)

您所在的位置:网站首页 rtos ui 【github项目】又发现一个轻量级开源UI nuklear,酷炫界面,支持矢量字体。 / 计算机图形/GUI/RTOS/FileSystem/OpenGL/DirectX/SDL2 / WhyCan Forum(哇酷开发者社区)

【github项目】又发现一个轻量级开源UI nuklear,酷炫界面,支持矢量字体。 / 计算机图形/GUI/RTOS/FileSystem/OpenGL/DirectX/SDL2 / WhyCan Forum(哇酷开发者社区)

2023-09-05 20:45| 来源: 网络整理| 查看: 265

/* GUI */    ctx = nk_d3d11_init(device, WINDOW_WIDTH, WINDOW_HEIGHT, MAX_VERTEX_BUFFER, MAX_INDEX_BUFFER);    /* Load Fonts: if none of these are loaded a default font will be used  */    /* Load Cursor: if you uncomment cursor loading please hide the cursor */    {struct nk_font_atlas *atlas;    nk_d3d11_font_stash_begin(&atlas);    /*struct nk_font *droid = nk_font_atlas_add_from_file(atlas, "../../extra_font/DroidSans.ttf", 14, 0);*/    /*struct nk_font *robot = nk_font_atlas_add_from_file(atlas, "../../extra_font/Roboto-Regular.ttf", 14, 0);*/    /*struct nk_font *future = nk_font_atlas_add_from_file(atlas, "../../extra_font/kenvector_future_thin.ttf", 13, 0);*/    /*struct nk_font *clean = nk_font_atlas_add_from_file(atlas, "../../extra_font/ProggyClean.ttf", 12, 0);*/    /*struct nk_font *tiny = nk_font_atlas_add_from_file(atlas, "../../extra_font/ProggyTiny.ttf", 10, 0);*/    /*struct nk_font *cousine = nk_font_atlas_add_from_file(atlas, "../../extra_font/Cousine-Regular.ttf", 13, 0);*/

    struct nk_font_config cfg = nk_font_config(19);    cfg.merge_mode = nk_false;    cfg.oversample_h = 1;    cfg.oversample_v = 1;    cfg.range = nk_font_chinese_glyph_ranges();    cfg.coord_type = NK_COORD_UV;    struct nk_font *font = nk_font_atlas_add_from_file(atlas, "msyh.ttf", 19, &cfg);

    nk_d3d11_font_stash_end();    /*nk_style_load_all_cursors(ctx, atlas->cursors);*/    /*nk_style_set_font(ctx, &droid->handle)*/;    nk_style_set_font(ctx, &font->handle);    }



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3